package com.atguigu.edu.realtime.dws.app;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.atguigu.edu.realtime.common.base.BaseApp;
import com.atguigu.edu.realtime.common.constant.Constant;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class DwsPlayVideoChapterWindow extends BaseApp {
    public static void main(String[] args) {
        new DwsPlayVideoChapterWindow().start(
                10022,
                4,
                "dws_play_video_chapter_window",
                Constant.TOPIC_DWD_PLAY_VIDEO_DETAIL
        );

    }
    @Override
    public void handle(StreamExecutionEnvironment env, DataStreamSource<String> kafkaStrDS) {
        //TODO 对流中的数据进行类型转换 jsonStr->jsonObj
        SingleOutputStreamOperator<JSONObject> jsonObjDs  = kafkaStrDS.map(JSON::parseObject);
        //TODO 按照

    }
}
